package com.googlecode.tinyjava.syntaxtree;

public class Constant extends TreeNode {
	int number;
	String str;
	boolean isBoolean = false;
	boolean bool = false;
	
	public Constant(int val){
		number = val;
	}

	public Constant(String val) {
		str = val;
	}

	public Constant(boolean b) {
		isBoolean = true;
		bool = b;
	}
	
	public void print() {
		if (isBoolean) {
			System.out.print(bool);
		} else if (str != null) {
			System.out.print(str);
		} else {
			System.out.print(number);
		}
	}
}
